<h1 style="color:#FF3300;margin-bottom:10px">Package Manager</h1>
<select id="drdprovide" onchange="location.assign('<?php echo base_url(); ?>admin/package/index?provide='+$('#drdprovide').val());">
	<option value="0" <?php if(isset($_GET['provide'])){ if($_GET['provide']=="0") echo "disabled selected";}?>>Choice Destination</option>
	<option value="bagan" <?php if(isset($_GET['provide'])){ if($_GET['provide']=="bagan") echo "disabled selected";}?>>Bagan</option>
    <option value="inle" <?php if(isset($_GET['provide'])){ if($_GET['provide']=="inle") echo "disabled selected";}?>>Inle</option>
    <option value="mandalay" <?php if(isset($_GET['provide'])){ if($_GET['provide']=="mandalay") echo "disabled selected";}?>>Mandalay</option>
    <option value="yangon" <?php if(isset($_GET['provide'])){ if($_GET['provide']=="yangon") echo "disabled selected";}?>>Yangon</option>
</select>
<input type="text" id="searchname" value="" placeholder="Title..."/>
<?php
				$package_title="";
				for($i=0;$i<count($data);$i++){
					if($i!=(count($data)-1)) $package_title.= '"'.$data[$i]['title'].'",';
					else $package_title.= '"'.$data[$i]['title'].'"';			
			}?>
			<script>
				$(function() {
					var package_title = [
					<?php echo $package_title; ?>
					];
					$("#searchname").autocomplete({
					source: package_title
					});
				});
          </script>
<input type="button" value=" " style="border:1px solid #d5d5d5;cursor:pointer;background:url(<?php echo base_url() ?>public/images/iconsearch_submit.png) no-repeat center center #143167; padding:0 5px" id="btnsearch">
<script>
	$('#searchname').click(function(){
		$('#searchname').removeClass('bxshadow_ff0000');								
	});
	$('#btnsearch').click(function(){
		if($('#searchname').val()==''){
			$('#searchname').addClass('bxshadow_ff0000');			
			return false;
		}else 
			<?php if(isset($_GET['provide'])){?>
				location.assign('<?php echo base_url(); ?>admin/package/index?provide=<?php echo $_GET['provide'] ?>&title='+$('#searchname').val());
			<?php }else{?>
				location.assign('<?php echo base_url(); ?>admin/package/index?provide=0&title='+$('#searchname').val());
			<?php }?>
	})
</script>
<input type="button" onclick="location.assign('<?php echo base_url(); ?>admin/package/edit');" value="Insert" style="float:right;margin-right:10px;margin-bottom:5px;"/>
<table cellpadding="0" cellspacing="0">
  <tr>
    <th>STT</th>
    <th>Title</th>
    <th>Number Day</th>
    <th>Destination</th>
    <th>Category</th>
    <th>Status</th>
    <th>Edit / Del</th>
    <th>Price</th>
    <th>Banner</th>
  </tr>
  <?php if(count($data)>0){ foreach($data as $k=>$list){?>
  <tr>
    <th><?php echo $k+1; ?></th>
    <td><?php echo $list["title"]; ?></td>
    <td align="center"><?php echo $list["numberday"]." day(s) ".($list['numberday']-1)."night(s)" ; ?></td>
    <th><?php echo $list["destination"]; ?></th>
    <td align="center"><?php 
			  if($list["category"]==1) echo "Special Offers";
			  if($list["category"]==2) echo "Cultural";
			  if($list["category"]==3) echo "Adventure & Active";
			  if($list["category"]==4) echo "Pilgrimage";
			  if($list["category"]==5) echo "Eco & Social";?></td>
    <th><select name="changestatus" onChange="location.assign('<?php echo base_url(); ?>/admin/package/changestatus?id=<?php echo $list["id"] ?>&status='+this.options[this.selectedIndex].value);">
        <option value="1" <?php if($list['status']==1) echo "selected";?>>Highlights</option>
        <option value="2" <?php if($list['status']==2) echo "selected";?>>Normal</option>
        <option value="3" <?php if($list['status']==3) echo "selected";?>>Hidden</option>
      </select></th>
    <th><a href="javascript:void(0);" onclick="location.assign('<?php echo base_url(); ?>admin/package/edit?id=<?php echo $list['id'] ?>');"><img src="<?php echo base_url(); ?>public/admin/img/icons/user_edit.png"/></a> <a href="javascript:void(0);" onClick="if(confirm('Do you want to Del this Information ?')) location.assign('<?php echo base_url(); ?>admin/package/delete?id=<?php echo $list["id"]; ?>');"><img src="<?php echo base_url(); ?>public/admin/img/icons/user_delete.png"/></a></th>
    <!--<th><a href="<?php echo base_url(); ?>admin/packagereview/index?packageid=<?php echo $list['id'] ?>">Reviews</a></th>-->
    <th><a href="<?php echo base_url(); ?>admin/packageprice/index?packageid=<?php echo $list['id'] ?>">Price</a></th>
    <th><a href="<?php echo base_url(); ?>admin/packagebanner/index?packageid=<?php echo $list['id'] ?>">Banner</a></th>
  </tr>
  <?php }}?>
</table>

